home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 6 / Amiga Format AFCD06 (Nov 1996, Issue 90).iso / serious / commercial / cloanto / colortype / rexx / reversedirection.ctrx < prev    next >
Text File  |  1996-08-28  |  1KB  |  71 lines

  1. /* ColorType Amiga Rexx script - Copyright © 1996 Cloanto Italia srl */
  2.  
  3. /* $VER: ReverseDirection.ctrx 1.0 */
  4.  
  5. /**
  6.  This script changes the spacing and kerning information of all characters
  7.  in the font, so that the resulting font is suitable for right-to-left
  8.  rather than left-to-right typing, or vice versa. This is equivalent to the
  9.  "Reverse Direction" menu item of the Personal Fonts Maker 2 software.
  10.  
  11.  This function is especially useful in combination with the "Flip Font"
  12.  command, which it complements (Reverse Direction changes the spacing and
  13.  kerning information, whereas Flip Font "flips" the character images).
  14. */
  15.  
  16. IF ARG(1, EXISTS) THEN
  17.     PARSE ARG CTPORT
  18. ELSE
  19.     CTPORT = 'COLORTYPE'
  20.  
  21. IF ~SHOW('P', CTPORT) THEN DO
  22.     IF EXISTS('ColorType:ColorType') THEN DO
  23.         ADDRESS COMMAND 'Run >NIL: ColorType:ColorType'
  24.         DO 30 WHILE ~SHOW('P',CTPORT)
  25.              ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  26.         END
  27.     END
  28.     ELSE DO
  29.         SAY "ColorType could not be loaded."
  30.         EXIT 10
  31.     END
  32. END
  33.  
  34. IF ~SHOW('P', CTPORT) THEN DO
  35.     SAY 'ColorType Rexx port could not be opened.'
  36.     EXIT 10
  37. END
  38.  
  39. ADDRESS VALUE CTPORT
  40. OPTIONS RESULTS
  41. OPTIONS FAILAT 10000
  42.  
  43.  
  44. LockGUI
  45. GetChar
  46. scnum = RESULT
  47.  
  48. SetChar FIRSTON
  49. IF RC = 0 THEN DO
  50.     Get 'DVIEW'
  51.     dvstatus = RESULT
  52.     Set '"DVIEW=0"'
  53.     DO FOREVER
  54.         GetSpace
  55.         space = RESULT
  56.         GetKern
  57.         kern = RESULT
  58.  
  59.         SetSpace (-kern)
  60.         SetKern (-space)
  61.  
  62.         SetChar NEXTON
  63.         IF RC ~= 0 THEN
  64.             LEAVE
  65.     END
  66.     SetAttr 'CHANGE 0x4000'
  67.     Set '"DVIEW='dvstatus'"'
  68.     SetChar scnum
  69. END
  70. UnlockGUI
  71.